package com.example.springboot_system.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author xgs
 * @date 2019-5-11
 * @description: 药物表
 */
@Data
@TableName("his_drug")
@NoArgsConstructor
@AllArgsConstructor
public class Drug {
    @Column(name = "id")
    private String id;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "create_datetime")
    private Date createDatetime;

    /*药物编号*/
    @Column(name = "num", nullable = false, length = 50)
    private double num = System.currentTimeMillis();

    @Column(name = "name", nullable = false, length = 255)
    private String name;

    @Column(name = "drug_type", nullable = false, length = 50)
    private String drugType;  //注射剂、片剂、胶囊、、、

    @Column(name = "specification", nullable = false, length = 50)
    private String specification;  //规格：多少

    @Column(name = "unit", nullable = false, length = 50)
    private String unit;   //规格单位

    @Column(name = "limit_status", nullable = false, length = 50)
    private int limitStatus;  //是否限制药物

    @Column(name = "efficacy_classification", nullable = false, length = 50)
    private String efficacyClassification;  //功效分类

    @Column(name = "wholesale_price", nullable = false, length = 50)
    private double wholesalePrice;  //批发价

    @Column(name = "price", nullable = false, length = 50)
    private double price;  //售价

    @Column(name = "manufacturer", nullable = false, length = 255)
    private String manufacturer;  //生产厂家

    @Column(name = "storage_quantity", nullable = false, length = 20)
    private int storageQuantity; //入库量


    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Column(name = "production_date", nullable = false, length = 50)
    private Date productionDate;  //生产日期

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Column(name = "quality_date", nullable = false, length = 50)
    private Date qualityDate;  //保质日期

}


